Splines are functions defined as piecewise polynomials of fixed degree. The points of connections of the polynomials are called knots. The idea is that, between two knots, the function \(f(x)\) is a said polynomial and such polynomials meets at the knots, with further constraints to achieve regularity constraints. For instance, given \(K\) knots \(\zeta_1, \ldots, \zeta_K\), a cubic (degree = 3) regression spline is expressed as \[f(x;\boldsymbol \beta)= \beta_0 +\beta_1 x + \beta_2 x^2 + \beta_3 x^3 + \sum_{k=1}^{K} \beta_{k+3} (x-\zeta_k)^3_{+} \] with \((x-\zeta_k)^3_{+}={\rm max}(0, (x-\zeta_k)^3)\). We call spline basis functions the \(h_j(x) = x^{j-1}\), \(j=1, \ldots, 4\) and \(h_j(x) = (x-\zeta_j)^3_{+}\), \(j=1, \ldots, k\). However, different basis expansions can be used to define a spline function and in general \[f(x;\boldsymbol \beta)= \sum_{k=0}^{K+d} \beta_{k} h_k(x) \]
We will adopt the B-spline which are built by means of the Cox–de Boor recursion formula.